package com.wy2.generator.database;


import cn.xo68.core.util.StringTools;
import com.wy2.generator.database.entity.DatabaseColumn;
import com.wy2.generator.database.util.JdbcTypeUtils;

/**
 * 数据库元数据解析器默认实现
 * @author nnsword
 * @date 2017-12-14 21:38:40
 *
 */
public class JdbcMetaDataResolverDefaultImpl implements JdbcMetaDataResolver {
	/* (non-Javadoc)
	 * @see com.wy2.generator.database.JdbcTypeResolver#getEntityNameByTableSqlName(java.lang.String)
	 */
	public String getEntityNameByTableSqlName(String tableSqlName) {
		return StringTools.makeAllWordFirstLetterUpperCase(tableSqlName);
	}
	
	/* (non-Javadoc)
	 * @see com.wy2.generator.database.JdbcTypeResolver#parse(java.lang.Integer)
	 */
	public String getFullJavaTypeBySqlType(DatabaseColumn column) {
		return JdbcTypeUtils.getFullJavaTypeByJdbcType(column);
	}

	/* (non-Javadoc)
	 * @see com.wy2.generator.database.JdbcTypeResolver#getJavaPropertyBySqlName(java.lang.String)
	 */
	public String getJavaPropertyBySqlName(String sqlName) {
		return StringTools.uncapitalize(StringTools.makeAllWordFirstLetterUpperCase(sqlName));
	}



}
